package com.future.wxapp.pedometer.controller;

import com.future.wxapp.common.domain.JsonResult;
import com.future.wxapp.common.util.ResponseUtil;
import com.future.wxapp.pedometer.service.ChickenInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

/***
 * @author li
 * @date 2020-1-28
 */
@Api(tags = "鸡信息")
@RestController
@RequestMapping("chicken")
public class ChickenInfoController {
    @Autowired
    private ChickenInfoService chickenInfoService;

    @ApiOperation("获取鸡信息")
    @PostMapping("/query")
    @ResponseBody
    public JsonResult query(@NotNull @RequestParam Integer id){
        JsonResult result = ResponseUtil.ok();
        result.setData(chickenInfoService.query(id));
        return result;
    }
}
